Conventionally, in a case of machining a workpiece having a large inertia (weight) by numerically controlling a machine tool, a time constant according to the maximum inertia ratio is set in a numerical control device, and the time constant remains unchanged until the machining is finished. Therefore, when the inertia is reduced due to cutting or other machining, this makes an allowance for further accelerating or decelerating a motor. However, because the time constant remains fixed, the cycle time cannot be reduced. Accordingly, a function of selecting an optimal time constant according to the weight of a workpiece has been proposed (see, for example, Patent Literature 1).